<div class="modal fade bs-modal-lg" id="modelContent">
	<div class="modal-dialog modal-lg">
        <div class="modal-content"></div>
    </div>
</div> 

<div class="portlet box green">
    <div class="portlet-title">
		<div class="caption"><i class="fa fa-cogs"></i>订单 &gt; 售后管理 &gt; 售后服务列表</div>
		<div class="tools"><a href="javascript:;" class="collapse" data-original-title="" title=""> </a></div>
    </div>
    <div style="background-color: rgb(249, 247, 161);">
		<label >
		注：1.系统商城发货之后，买家可申请仅退款和退货退款，收货以后可申请仅退款、退货退款、换货，且门店提货订单不支持换货；<br/>
        2.仅退款买家不需要退货，所以需要谨慎；门店提货订单申请退货退款时，可以选择到店退货或物流退货；所有物流订单都需要通过物流退货。</label>
	</div>
    <div class="portlet-body">
    	<div class="tabbable-line ">
			<ul class="nav nav-tabs ">
				<li #if($!searchModel.orderState=='TREASURER_AUDIT') class="active" #end>
					<a href="/afterMarketOrder/list?orderState=BEING_REFUND" class="ajaxify">待退款</a>
				</li>
				<li #if(!$!searchModel.orderState) class="active" #end>
					<a href="/afterMarketOrder/list" class="ajaxify">全部</a>
				</li>
			</ul>
			<div class="tab-content">
				<div class="tab-pane active form">
				</div>
			</div>
		</div>
		<div class="portlet-body form">
		   	<form action="/afterMarketOrder/list" class="form-horizontal" method="get" id="searchForm" onsubmit="return false">
				<div class="form-body">
					<div class="row">
						<div class="col-md-3">
							<label class="col-md-4 control-label">订单号：</label>
							<div class="col-md-8">
						    	<input type="text" class="form-control" name="id" value="$!searchModel.id">
							</div>
						</div>
						<div class="col-md-3">
							<label class="col-md-4 control-label">申请会员：</label>
							<div class="col-md-8">
						    	<input type="text" class="form-control" name="username" value="$!searchModel.username">
							</div>
						</div>
						<div class="col-md-3">
							<label class="col-md-4 control-label">售后类型：</label>
							<div class="col-md-6">
						    	<select name="reOrderType" class="form-control">
								<option value="">全部</option>
		                    	<option value="REFUNDANDGOODS" #if($!searchModel.reOrderType=='REFUNDANDGOODS') selected #end>退货退款</option>
		                        <option value="CHANGEGOODS" #if($!searchModel.reOrderType=='CHANGEGOODS') selected #end>换货</option>
		                        <option value="REFUND" #if($!searchModel.reOrderType=='REFUND') selected #end>仅退款</option>
		                        <option value="IN_REPAIR" #if($!searchModel.reOrderType=='IN_REPAIR') selected #end>维修</option>
		                    </select>
							</div>
						</div>
						<div class="col-md-3">
							<label class="col-md-4 control-label">售后状态：</label>
							<div class="col-md-6">
						    	<select name="orderState" class="form-control">
								<option value="">全部</option>
		                    	<option value="WAIT_AUDIT" #if($!searchModel.orderState=='WAIT_AUDIT') selected #end>待审核</option>
		                        <option value="TREASURER_AUDIT" #if($!searchModel.orderState=='TREASURER_AUDIT') selected #end>财务审核</option>
		                        <option value="BEING_REFUND" #if($!searchModel.orderState=='BEING_REFUND') selected #end>退款中</option>
		                        <option value="REFUND_FINISH" #if($!searchModel.orderState=='REFUND_FINISH') selected #end>售后完成</option>
		                        <option value="WAIT_RETURN_GOODS" #if($!searchModel.orderState=='WAIT_RETURN_GOODS') selected #end>等待退货</option>
		                        <option value="RETURNING_GOODS" #if($!searchModel.orderState=='RETURNING_GOODS') selected #end>退货中</option>
		                        <option value="RETURNED_GOODS" #if($!searchModel.orderState=='RETURNED_GOODS') selected #end>完成退货</option>
		                        <option value="EXCHANGE_GOODS" #if($!searchModel.orderState=='EXCHANGE_GOODS') selected #end>换货发货</option>
		                        <option value="EXCHANGE_SENDED_GOODS" #if($!searchModel.orderState=='EXCHANGE_SENDED_GOODS') selected #end>换货已发货</option>
		                    </select>
							</div>
						</div>
		    		</div>
		    		<div class="row">
		    		&nbsp;<br/>
		    		</div>
		    		<div class="row">
						<div class="col-md-3">
							<label class="col-md-4 control-label">所属企业：</label>
							<div class="col-md-8">
						    	<input type="text" class="form-control" name="company" value="$!searchModel.company">
							</div>
						</div>
						<div class="col-md-4">
							<label class="col-md-3 control-label">申请时间：</label>
							<div class="col-md-4">
						    	<input type="text" class="form-control" readOnly id="startTime" name="startTime" value="$!startTime">
						    	<i class="fa fa-calendar" style="position: absolute;right: 10px;top: 10px"></i>
							</div>
							<div class="col-md-1">~</div>
							<div class="col-md-4">
						    	<input type="text" class="form-control"readOnly id="endTime" name="endTime" value="$!endTime">
						    	<i class="fa fa-calendar" style="position: absolute;right: 10px;top: 10px"></i>
							</div>
						</div>
						<div class="col-md-2">
							<div class="actions col-md-12">
								<a href="javascript:;" class="btn green btn-sm ajax-search"><i class="fa fa-search"></i> 查询 </a>
								<a href="javascript:;" class="btn green btn-sm search-reset"><i class="fa fa-eraser"></i> 清除 </a>
							</div>
						</div>
		    		</div>
				</div>
				
			</form>
		</div>
		
    	<div class="dataTables_wrapper no-footer">
			<div class="table-scrollable">
			    <table class="table table-striped table-bordered table-hover">
				  	<thead>
						<tr>
		   		 			<th>售后订单号</th>
		   		 			<th>订单号</th>
		   		 			<th>申请会员</th>
		   		 			<th>售后类型</th>
		   		 			<th>售后状态</th>
		   		 			<th>申请时间</th>
		   		 			<th>所属企业</th>
		   		 			<th>详情</th>
							<th class="col-md-2">操作</th>
						</tr>
					</thead>
					<tbody>
					#foreach($item in $pageOrder.result)
		  				<tr>
						    <td>
						    	$!item.id
						    </td>
						    <td>$!item.orderId</td>
						    <td>$!item.username</td>
						    <td>$!item.reOrderType.name</td>
						    <td>$!item.orderState.name</td>
						     <td>$!item.createDate</td>
						    <td>$!item.company</td>
						    <td>
						   	<a class="btn btn-outline btn-sm ajaxify" href="/afterMarketOrder/show?id=$!item.id">详情</a>
						    </td>
			    			<td>
			    				#if($!item.orderState == 'WAIT_AUDIT')
						    	<a class="btn green btn-outline btn-sm ajax-operation" thref="/afterMarketOrder/pass?id=$!item.id" tohref="/afterMarketOrder/list"> 
									<i class="fa fa-check"></i>通过
								</a>
								<a class="btn green btn-outline btn-sm ajax-operation" thref="/afterMarketOrder/refuse?id=$!item.id" tohref="/afterMarketOrder/list"> 
									<i class="fa fa-remove"></i>拒绝
								</a>
								#end
								#if($!item.orderState == 'TREASURER_AUDIT')
									<a class="btn green btn-outline btn-sm ajax-operation" thref="/afterMarketOrder/financePass?id=$!item.id" tohref="/afterMarketOrder/list"> 
										<i class="fa fa-check"></i>通过
									</a>
								#end
								#if($!item.orderState == 'BEING_REFUND')
									<a class="btn green btn-outline btn-sm ajax-model-get" href="#modelContent" thref="/afterMarketOrder/reFund?id=$!item.id" data-toggle="modal"> 
										<i class="fa fa-check"></i>退款
									</a>
								#end
								#if($!item.orderState == 'RETURNING_GOODS')
									<a class="btn green btn-outline btn-sm ajax-operation" thref="/afterMarketOrder/reviceGoods?id=$!item.id" tohref="/afterMarketOrder/list"> 
										<i class="fa fa-check"></i>收货完成
									</a>
								#end
						    </td>		  			
		  				</tr>
					#end
					</tbody>
				</table>
			</div>
			#set($page=$pageOrder)
			#set($pageUrl="/afterMarketOrder/list?orderState=$!searchModel.orderState&pageNo=")
			#parse("_page.htm")
		</div>
    </div>
</div>
<script src="/assets/scripts/views-date.js" type="text/javascript"></script>
<script type="text/javascript">

ComponentsSelect2.initWithSearch()
MyTouchSpin.init()

</script>
<script type="text/javascript">
$("input[name= id]").focus();
</script>
